import request from '../utils/request'

/**
 * 新增事故
 */
export function storeAccidentSociety(params) {
  return request({
    url: '/api/accidentSociety',
    method: 'post',
    data: {...params}
  })
}

/**
 * 修改事故
 */
export function updateAccidentSociety(form, id) {
  return request({
    url: `/api/accidentSociety/${id}`,
    method: 'put',
    data: {...form, id}
  })
}

/**
 * 删除事故
 */
export function destroyAccidentSociety(ids) {
  return request({
    url: '/api/accidentSociety',
    method: 'delete',
    data: {ids}
  })
}

/**
 * 事故列表
 */
export function accidentSocietyList(params) {
  return request({
    url: '/api/accidentSocietyList',
    method: 'post',
    data: {...params}
  })
}

/**
 * 获取申请单详细数据以修改
 */
export function editAccidentSociety(id) {
  return request({
    url: `/api/accidentSociety/${id}`,
    method: 'get',
    data: {id}
  })
}

/**
 * 审核维修申请单
 * @returns {*}
 */
export function auditAccidentSociety(params) {
  return request({
    url: '/api/accidentSociety/audit',
    method: 'post',
    data: {params}
  })
}